<template>
  <div>
    <button @click.stop="btn">生成</button>
    <ul>
      <li v-for="item in arr" :key="item">{{ item }}</li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: [],
    };
  },
  methods: {
    btn() {
      let num = parseInt(Math.random() * 10);
      this.arr.push(num);
    },
  },
};
</script>

<style scoped>
</style>

